package com.scm.converter;

import com.scm.dto.req.order.OrderImportBean;
import com.scm.dto.resp.product.ScmProductDetailOmsDo;
import com.scm.dto.resp.product.ScmProductDo;
import com.scm.persist.model.ScmOrder;
import com.scm.persist.model.ScmProduct;
import com.scm.persist.model.ScmProductDetailOms;

public class ProductConverter {

    public static ScmProduct convertScmProductDoToScmProduct(Long tenantId, ScmProductDo scmProductDo ) {
        ScmProduct record = new ScmProduct ();
        record.setId(scmProductDo.getId());
        record.setTenantId(tenantId);
        record.setProductCode(scmProductDo.getProductCode());
        record.setProductName(scmProductDo.getProductName());
        record.setProductUnit(scmProductDo.getProductUnit());
        record.setBrand(scmProductDo.getBrand());
        record.setRemark(scmProductDo.getRemark());

        return record;

    }

    public static ScmProductDetailOms convertScmProductDoToScmProductDetailOms(Long tenantId, ScmProductDo scmProductDo ) {

        ScmProductDetailOmsDo productDetailOmsDo = scmProductDo.getProductDetailOmsDo();

        ScmProductDetailOms record = new ScmProductDetailOms ();
        record.setTenantId(tenantId);
        record.setScmProductId(scmProductDo.getId());
        record.setItemcode(scmProductDo.getProductCode());
        record.setItemname(scmProductDo.getProductName());
        record.setFrgnname(scmProductDo.getRemark());
        record.setUnitcode(scmProductDo.getProductUnit());
        record.setBrandname(scmProductDo.getBrand());


        record.setKind1(productDetailOmsDo.getKind1());
        record.setKind2(productDetailOmsDo.getKind2());
        record.setKind3(productDetailOmsDo.getKind3());
        record.setModel(productDetailOmsDo.getModel());
        record.setParameter(productDetailOmsDo.getParameter());
        record.setColor(productDetailOmsDo.getColor());
        record.setEcPreviewUrl(productDetailOmsDo.getEcPreviewUrl());
        record.setInvoiceName(productDetailOmsDo.getInvoiceName());
        record.setTaxRateText(productDetailOmsDo.getTaxRateText());
        record.setTaxCode(productDetailOmsDo.getTaxCode());

        return record;

    }

}
